package cn.wx.scholar.neo4j.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.wx.common.persistence.base.BaseController;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.scholar.neo4j.entity.qo.Neo4jSocialQ;
import cn.wx.scholar.neo4j.service.Neo4jSocialService;

/**
 *   @description : 社交媒体数据 控制器
 *   ---------------------------------
 *   @author  
 *   @since 2018-07-14
 */
@RestController
@RequestMapping("/sholar/neo4j/social")
public class Neo4jSocialController extends BaseController {
	
	@Autowired
    private Neo4jSocialService neo4jSocialService;
	
	/**
	 * 根据专家的Id获取该专家所有的社交媒体数据
	 * @param id
	 * @return
	 */
    @RequestMapping(value = "/getSocials", method = RequestMethod.POST)
	public ResponseData getSocialsById(Neo4jSocialQ neo4jSocialQ){
		return success(neo4jSocialService.findAllSocialByExpertId(neo4jSocialQ));
    }
    
    /**
	 * 根据新闻id获取新闻详情
	 * @param id
	 * @return
	 */
    @RequestMapping(value = "/queryUnique", method = RequestMethod.POST)
	public ResponseData queryUnique(@RequestParam(value = "id") Long id){
		return success(neo4jSocialService.findOneSocial(id));
    }
}
